import 'package:fluro/fluro.dart';
import 'package:flutter_base_plugin_example/page/details/goods/goods_details_page.dart';
import 'package:flutter_base_plugin_example/page/index_page.dart';
import 'package:flutter_base_plugin_example/page/login/login_page.dart';

import '../page/home/home_page.dart';
import '../page/main/main_page.dart';
import '../page/user/user2_page.dart';
import '../page/user/user3_page.dart';
import '../page/user/user_page.dart';

Handler NotFoundHandler = Handler(handlerFunc: (context, params) {
  print('ERROR====>ROUTE WAS NOT FONUND!!!');
});

Handler HomePageHandler = Handler(handlerFunc: (context, params) {
  print(params);
  String id = params["id"]?.first as String;
  String name = params["name"]?.first as String;
  return HomePage();
});

Handler UserPageHandler = Handler(handlerFunc: (context, params) {
  // print(params);
  // String id = params["id"]?.first as String;
  // String name = params["name"]?.first as String;
  return UserPage();
});

Handler User2PageHandler = Handler(handlerFunc: (context, params) {
  // print(params);
  // String id = params["id"]?.first as String;
  // String name = params["name"]?.first as String;
  return User2Page();
});

Handler User3PageHandler = Handler(handlerFunc: (context, params) {
  // print(params);
  // String id = params["id"]?.first as String;
  // String name = params["name"]?.first as String;
  return User3Page();
});
Handler MainPageHandler = Handler(handlerFunc: (context, params) {
  return MainPage();
});
Handler IndexPageHandler = Handler(handlerFunc: (context, params) {
  return IndexPage();
});

Handler LoginPageHandler = Handler(handlerFunc: (context, params) {
  return LoginPage();
});

Handler GoodsDetailsPageHandler = Handler(handlerFunc: (context, params) {
  String id = params["id"]?.first as String;
  return GoodsDetailsPage(int.parse(id));
});
